package com.tenbit.emp.dao;

import java.util.List;

import org.apache.log4j.Logger;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.tenbit.emp.svc.EMP1010SVC;
import com.tenbit.emp.vo.EMP1010VO;

import emp.tenbit.emp.bean.SearchEmpBean;

@Component
public class EmployeeEDAO extends SqlSessionDaoSupport{
	@Autowired
	private SqlSessionTemplate sqlSession;
	private Logger log=Logger.getLogger(this.getClass());
	
	public List<EMP1010VO> listEmployee(){
		return (List<EMP1010VO>)sqlSession.selectList("listEmployee");
	}
	public void insertEmployee(EMP1010VO emp){
		log.debug("insertEmployee"+emp);
		sqlSession.insert("insertEmployee", emp);
	}
	public String selectEmployeeSeq(){
		return (String)sqlSession.selectOne("selectEmployeeSeq");
	}
	public void deleteEmployee(String emp_id){
		log.debug("=========================>deleteEmployee "+emp_id);
		sqlSession.delete("deleteEmployee", emp_id);
	}
	public void updateEmploye(EMP1010VO emp){
		log.debug("updateEmploye"+emp);
		sqlSession.update("updateEmploye", emp);
	}
	public EMP1010VO selectEmployee(String empId){
		return (EMP1010VO)sqlSession.selectOne("selectEmployee", empId);
	}
}